﻿using System;
using System.Xml;
using TrainingPeaksProvider.TrainingPeaksWebService;

namespace TrainingPeaksProvider
{
    public class TrainingPeaksDataService
    {
        public static void Get()
        {
            string sUserName = "tunechr";
            string sPassword = "cr1spy860";
            int nUserId = 115133;
            Byte[] bData;

            var ws = new ServiceSoapClient("ServiceSoap");
            PersonBase[] person = ws.GetAccessibleAthletes(sUserName, sPassword,
                                                           AthleteAccountTypes.SharedSelfCoachedPremium);

            string version = ws.Version();

            DateTime dtNow = DateTime.Now;
            dtNow = dtNow.AddDays(-30);

            Workout[] workouts1 = ws.GetWorkoutsForAthlete(sUserName, sPassword, dtNow, DateTime.Now.AddDays(30));
            Workout[] workouts2 = ws.GetWorkoutsForAccessibleAthlete(sUserName, sPassword, nUserId, dtNow,
                                                                     DateTime.Now.AddDays(30));
            XmlNode workouts3 = ws.GetExtendedWorkoutDataForAccessibleAthlete(sUserName, sPassword, nUserId, 62495697);
            //62495697
//Dim workout As trainingpeaksWS.Workout = New trainingpeaksWS.Workout();


//ws.ImportFileForUser(sUserName, sPassword, bData)
        }
    }
}